package com.mh.www.mh_frame.model.db.manager;

import android.os.Environment;
import android.text.TextUtils;

import java.io.File;

/**
 * @author think
 * @version [版本号, 2018/2/5]
 * @see [相关类/方法]
 * @since [V1]
 */

class CommonUtils {
    public static String getSDPath() {
        boolean sdCardExist = Environment.getExternalStorageState().equals(
                Environment.MEDIA_MOUNTED);
        if (sdCardExist) {
            return Environment.getExternalStorageDirectory().toString();
        } else {
            return "";
        }
    }


    public static String getDBPath() {
        String sdCardPath = getSDPath();
        if (TextUtils.isEmpty(sdCardPath)) {
            return "";
        } else {
            return sdCardPath + File.separator + "GreenDao"
                    + File.separator + "sqlite";
        }
    }
}
